
package CSS::Preprocessor::Expression::Call;

use base qw(CSS::Preprocessor::Expression);
use strict;
use warnings;
use constant FIELDS => [qw(
    args
    expr
)
];
use fields @{&FIELDS};

use Carp;

sub new {
    my ($class, %args) = @_;

    my $self = $class->SUPER::new();

    foreach my $k (@{&FIELDS}) {
        $self->{$k} = delete $args{$k};
    }

    croak "Unrecognised arguments ".join(',',keys %args) if %args;

    return $self;
}

sub _as_string_inner {
    my $self = shift;

    return "call ".$self->{expr}." with (".join(', ', @{$self->{args}}).")";
}

=head1 NAME

CSS::Preprocessor::Expression::Call - Class representing a @-call expression

=cut

1;

